package com.joint.base.dao.impl;


import com.fz.us.base.bean.BaseEnum;
import com.joint.base.dao.ProcessBriefDao;
import com.joint.base.dao.TaskFlowDao;
import com.joint.base.entity.ProcessBrief;
import com.joint.base.entity.TaskFlow;
import com.joint.base.entity.Users;
import com.joint.base.parent.BaseEntity;
import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;

import java.util.List;

/**
 * Dao实现类 - 岗位
 * ============================================================================
 * 版权所有 2013 。
 * 
 * @author 
 * @version 0.1 2013-1-16
 * ============================================================================
 */

@Repository
public class ProcessBriefDaoImpl extends BaseEntityDaoImpl<ProcessBrief, String> implements ProcessBriefDao {


    @Override
    public ProcessBrief getInfoByTableKey(String tableKey) {
        String hql = " from ProcessBrief where tableKey = :tableKey and state = :state";
        List<ProcessBrief>  processBriefList = getSession().createQuery(hql).setParameter("tableKey", tableKey)
                .setParameter("state", BaseEnum.StateEnum.Enable).list();
        if(processBriefList.size()>0){
            return  processBriefList.get(0);
        }
        return null;
    }
}